package com.naza.rpc.consumer.balance;

import com.naza.rpc.model.ServiceInstance;

import java.util.List;

/**
 * 负载均衡路由组件 ： 随机+轮询
 * @author yl
 */
public interface LoadBalancer {

    /**
     * select a client from list,if no available,return null;
     *
     * @param serviceName serviceName
     * @param candidates    candidates
     * @return select client,if no return null.
     */
    public ServiceInstance selectClient(String serviceName, List<ServiceInstance> candidates);

}
